package com.maben.disruptor.task;

import cn.hutool.core.date.DateUtil;
import com.maben.disruptor.producer.DisruptorMqService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Date;

@Component
public class TestSendMessage {
    @Resource
    private DisruptorMqService disruptorMqService;

    /**
     * 测试定时发送消息
     */
    @Scheduled(fixedDelay = 1000 * 3)
    public void testSendMessage2Test(){
        disruptorMqService.sendMessage2TestMq(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
    }
}
